Ext.define('TS.model.sale.SaleBillModel',{
	extend: 'Ext.data.Model',	
	fields: [
	  {name: 'billId',type:'int'},
	  {name: 'billCode',type:'string'},
	  {name: 'billType',type:'int'},
	  {name: 'billName',type:'string'},
	  {name: 'billDate',type:'date'},
	  {name: 'direct',type:'int'},
	  {name: 'custId',type:'int'},
	  {name: 'deptId',type:'int'},
	  {name: 'empId',type:'int'},
	  {name: 'makerId',type:'int'},
	  {name: 'status',type:'int'},
	  {name: 'fyear',type:'int'},
	  {name: 'period',type:'int'},
	  {name: 'archived',type:'boolean'},
	  {name:'deleted',type:'boolean'},
	  {name: 'remark',type:'string'}
	],
	associations:[
	  {type: 'hasOne',model: 'TS.model.base.CustomerModel',associatedName:'customer',associationKey:'customer'},
	  {type: 'hasOne',model: 'TS.model.base.DeptModel',associatedName: 'dept',associationKey:'dept'},
	  {type: 'hasOne',model: 'TS.model.base.EmpModel',associatedName: 'emp',associationKey:'emp'},
	  {type: 'hasOne',model: 'TS.model.base.EmpModel',associatedName: 'maker',associationKey:'maker'},
	  {type: 'hasOne',model: 'TS.model.common.BillAmountModel',associatedName: 'billAmount',associationKey:'billAmount'},
	  {type: 'hasOne',model: 'TS.model.common.BillExtendModel',associatedName: 'billExtend',associationKey:'billExtend'}
	],
	hasMany:{model:'TS.model.sale.SaleBillDetailModel',name:'details',associationKey:'details'}
});

/*private Long billId;
	private String billCode;
	private Date billDate = new Date(System.currentTimeMillis());
	private Integer custId;
	private Integer billType;
	private String billName;
	private Integer direct;
	private Integer deptId;
	private Integer empId;
	private Integer makerId;
	private Integer status = 0;
	private Integer fyear;
	private Integer period;
	private Boolean archived = false;
	private Boolean deleted = false;
	private String remark;
	
	private List<BillDetail> details = new ArrayList<BillDetail>();
	private int detailIndex = -1;
	private BillExtend billExtend;
	private Customer customer;
	private Dept dept;
	private Emp emp;
	private Emp maker;
	private BillAmount billAmount;*/